// +----------------------------------------------------------------------
// | Manong.Cloud [ Áì¿áÂëÅ©ÔÆ ]
// +----------------------------------------------------------------------
// | Copyright (c) 2020 http://www.manong.cloud All rights reserved.
// +----------------------------------------------------------------------
// | Author: µ¾²ÝÈË <qinuoyun@qq.com>
// +----------------------------------------------------------------------
// | Member: Î§Æå Æ®ÒÝÕß Loumt Silence24
// +----------------------------------------------------------------------
class User extends CommonModels {
  tableFields() {
    return {
      "open_id": {
        "label": "微信openID",
        "type": "varchar(64)"
      },
      "mobile": {
        "label": "手机号",
        "type": "varchar(11)"
      },
      "real_name": {
        "label": "真实姓名",
        "type": "varchar(255)"
      },
      "company_id": {
        "label": "公司ID",
        "type": "bigint(20)"
      },
      "id_card": {
        "label": "身份证信息",
        "type": "varchar(18)"
      },
      //用户头像
      "avatarUrl": {
        "label": "用户头像",
        "type": "varchar(500)",
      },
      //户籍地址
      "card_province": {
        "label": "省",
        "type": "varchar(64)",
      },
      "card_city": {
        "label": "市",
        "type": "varchar(64)",
      },
      "card_area": {
        "label": "区",
        "type": "varchar(64)",
      },
      "card_street": {
        "label": "街道",
        "type": "varchar(64)",
      },
      "card_province_name": {
        "label": "省",
        "type": "varchar(64)",
      },
      "card_city_name": {
        "label": "市",
        "type": "varchar(64)",
      },
      "card_area_name": {
        "label": "区",
        "type": "varchar(64)",
      },
      "card_street_name": {
        "label": "街道",
        "type": "varchar(64)",
      },
      "card_address": {
        "label": "详细地址",
        "type": "text",
      },
      //现住地址
      "live_province": {
        "label": "省",
        "type": "varchar(64)",
      },
      "live_city": {
        "label": "市",
        "type": "varchar(64)",
      },
      "live_area": {
        "label": "区",
        "type": "varchar(64)",
      },
      "live_street": {
        "label": "街道",
        "type": "varchar(64)",
      },
      "live_province_name": {
        "label": "省",
        "type": "varchar(64)",
      },
      "live_city_name": {
        "label": "市",
        "type": "varchar(64)",
      },
      "live_area_name": {
        "label": "区",
        "type": "varchar(64)",
      },
      "live_street_name": {
        "label": "街道",
        "type": "varchar(64)",
      },
      "live_address": {
        "label": "街道",
        "type": "text",
      },
      "card_bck": {
        "label": "身份证国徽面",
        "type": "varchar(255)",
      },
      "card_pre": {
        "label": "身份证人像面",
        "type": "varchar(255)",
      },
      "face_option": {
        "label": "人脸采集开关",
        "type": "int(1)",
      },
      "head": {
        "label": "人脸录入信息",
        "type": "text",
      },
      "certification": {
        "label": "实名认证",
        "type": "int(1)",
      },
    }
  }

  rules() {
    return {}
  }

  getCompany() {
    return this.hasOne({name: M('Company').tableName(), as: 'company'}, 'id', 'company_id');
  }

  tableName() {
    return '{{%user}}';
  }
}

export default User;
